package controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import pojo.Dev;
import service.DevServiceImpl;
import util.AjaxResult;

@RestController
@RequestMapping("/dev")
public class ControllerDev {
    @Autowired
    private DevServiceImpl devService;
    @RequestMapping("/devLogin")
    public AjaxResult devLogin(@RequestParam(required = false) String devCode, @RequestParam(required = false) String devPassword){
        Dev dev = devService.devLogin(devCode,devPassword);
        if(dev==null){
            return AjaxResult.error("用户名或密码不正确");
        }
        return AjaxResult.success(dev);
    }
}